package net.interpreader.client;

import java.util.ArrayList;

import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.user.client.Window;

public class Annotation {
	private String annotation = "";

	String for_all = "∀";
	String there_exists = "∃";
	String conjunction = "∧";
	String disjunction = "∨";
	String implication = "⇒";
	String negation = "¬";
	String identity = "≡";
	
	public void clear() {
		annotation = "";
	}

	public String getAnnotation() {
		return annotation;
	}

	public void setAnnotation(char input) {
		if (input == 'a') {
			// String charCode = Character.toString(event.getCharCode());
			// newAnnotationTextBox.setHTML(newAnnotationTextBox.getHTML()
			// + for_all);
			// formalToParaphraseTranslation.setHTML("<b>For all</b>");
			// Window.alert(charCode);
			// modifyAnnotation(charCode);
			annotation = annotation + for_all;
		} else if (input == 'e') {
			annotation = annotation + there_exists;
		} else if (input == 'c') {
			annotation = annotation + conjunction;
		} else if (input == 'd') {
			annotation = annotation + disjunction;
		} else if (input == 'i') {
			annotation = annotation + implication;
		} else if (input == 'n') {
			annotation = annotation + negation;
		} else if (input == '=') {
			annotation = annotation + identity;
		}
		// else if (input == 'x') {
		// int newAnnotationVariableIndex = annotationVariables.size();
		// String annotationVariable = "x<sub>"
		// + newAnnotationVariableIndex + "</sub>";
		// annotationVariables.add(annotationVariable);
		// newAnnotationTextBox.setHTML(newAnnotationTextBox.getHTML()
		// + annotationVariable);
		// } else if (event.getCharCode() == '0'
		// || event.getCharCode() == '1'
		// || event.getCharCode() == '2'
		// || event.getCharCode() == '3'
		// || event.getCharCode() == '4'
		// || event.getCharCode() == '5'
		// || event.getCharCode() == '6'
		// || event.getCharCode() == '7'
		// || event.getCharCode() == '8'
		// || event.getCharCode() == '9') {
		// int annotationVariableIndex = event.getCharCode();
		// newAnnotationTextBox.setHTML(annotationVariables
		// .get(annotationVariableIndex));
		// } else if (event.getCharCode() == KeyCodes.KEY_ENTER) {
		// addAnnotation();
		// }
	}

	// private void modifyAnnotation(String charCode) {
	// if (charCode == "a") {
	//
	// }

}